﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Text;

namespace crm_data
{
    /// <summary>
    /// 订单信息
    /// </summary>
    [Table("basics_order")]
    public class Order : Entity
    {
        #region Model 实体属性

        /// <summary>
        /// 订单单号
        /// </summary>
        public string OrderSn { get; set; }
        /// <summary>
        /// 订单状态
        /// </summary>
        public OrderStatusEnum OrderStatus { get; set; } = OrderStatusEnum.NoPayment;
        /// <summary>
        /// 商品数量
        /// </summary>
        public int ProductCount { get; set; }
        /// <summary>
        /// 商品总价
        /// </summary>
        public decimal ProductAmountTotal { get; set; }
        /// <summary>
        /// 订单金额
        /// </summary>
        public decimal OrderAmountTotal { get; set; }
        /// <summary>
        /// 运费金额
        /// </summary>
        public decimal LogisticsFee { get; set; }
        /// <summary>
        /// 是否开箱验货
        /// </summary>
        public bool IsUnpackingInspection { get; set; }
        /// <summary>
        /// 是否开具发票
        /// </summary>
        public bool IsInvoice { get; set; }
        /// <summary>
        /// 第三方支付流水号
        /// </summary>
        public string OutTradeNo { get; set; }
        /// <summary>
        /// 创建时间
        /// </summary>
        public DateTime CreateTime { get; set; }
        /// <summary>
        /// 付款时间
        /// </summary>
        public DateTime PaymentTime { get; set; }
        /// <summary>
        /// 发货时间
        /// </summary>
        public DateTime DeliveryTime { get; set; }
        /// <summary>
        /// 订单备注
        /// </summary>
        public string Remark { get; set; }

 
        #endregion Model 实体属性

        /// <summary>
        /// 订单发票
        /// </summary>
        public virtual OrderInvoice OrderInvoice { get; set; }
        /// <summary>
        /// 订单物流信息
        /// </summary>
        public virtual OrderLogistics OrderLogistics { get; set; }
        /// <summary>
        /// 订单商品详情信息
        /// </summary>
        public virtual ICollection<OrderDetail> OrderDetails { get; set; }
    }
}
